<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<script type="text/javascript">
		function my$(id){
			return document.getElementById(id);
		}
		
		
		window.onload=()=>{
			//获取某元素内部多个元素,只要在内部都会受到影响！
			var spanArr = document.getElementById("div1").getElementsByTagName("span");
			for (let i = 0; i < spanArr.length; i++) {
				spanArr[i].style.color = "red";
			}
			
		}
	</script>
	<body>
		<div id="div1">
			<span id="">
				123
			</span>
			<span id="">
				123
			</span>
		</div>
	</body>
</html>